package com.pattern.CreationalPatterns.AbstractFactoryPattern;

/**
 * @author: 月光伴奏
 * @Date 2017-11-28 18:58
 */
public class ColorFactory extends AbstractFactory{
    @Override
    public Shape getShape(String shapeType){
        return null;
    }

    @Override
    Color getColor(String color) {
        if(color == null){
            return null;
        }
        if(color.equalsIgnoreCase("RED")){
            return new Red();
        } else if(color.equalsIgnoreCase("GREEN")){
            return new Green();
        } else if(color.equalsIgnoreCase("BLUE")){
            return new Blue();
        }
        return null;
    }
}
